<?php
namespace Admin\Controller;
use Think\Controller;
class OrderController extends Controller
{
    public function index()
    {
        $this->display();
       
    }

    /*用户信息*/
   
    public function shorderlist(){
        $order = M('order');
        $orderlist = $order->order("oid asc")->field('oid,actname,otyoe,actpic,actcost,acttime,userphone,otime,onote,o_state')->select();

        for($index=0;$index<count($orderlist);$index++)
        {
            $orderlist[$index]['number']=$index+1;
        }

        $this->assign('orderlist',$orderlist);
        $this->display();
    }

   
    //设置禁用
    public function state(){
        $oid=I('oid');
        $order= M('order');
        // 要修改的数据对象属性赋值
        $data['o_state'] = 1;
        if($order->where("oid=$oid")->save($data)) {
            $this->success('设置同意成功');
        }else{
            $this->error('设置同意失败');
        }
    }
    //取消禁用
   public function restate(){
        $oid=I('oid');
        $order= M('order');
        // 要修改的数据对象属性赋值
        $data['o_state'] = 0;
        if($order->where("oid=$oid")->save($data)) {
            $this->success('设置不同意成功');
        }else{
            $this->error('设置不同意失败');
        }
    }
}